1. The Field of the Invention
The present invention relates generally to computer-generated graphics, and more specifically relates to modeling and rendering specular reflection of light.
2. Background and Relevant Art
As computerized systems have increased in popularity so have the range of applications that incorporate computational technology. Computational technology now extends across a broad range of applications, including a wide range of productivity and entertainment software. Indeed, computational technology and related software can now be found in a wide range of generic applications that are suited for many environments, as well as fairly industry-specific software.
One such industry that has employed specific types of software and other computational technology increasingly over the past few years is that related to building and/or architectural design. In particular, architects and interior designers (“or designers”) use a wide range of computer-aided design (CAD) software for designing the aesthetic as well as functional aspects of a given residential or commercial space. For example, a designer might use a CAD program to design the interior layout of an office building. The designer might then render the layout to create a three-dimensional model of the interior of the office building that can be displayed to a client.
While three-dimensional rendering is becoming a more common feature in CAD programs, three-dimensional rendering is a fairly resource intensive process. For example, a traditional rendering program can take anywhere from several minutes to several hours to appropriately render all of the lighting and shading effects of a given space with accuracy. This may be particularly inconvenient to a designer who has to wait for the scene to render after making a change to the layout of the scene. Alternatively, some rendering programs may use methods of rendering that result in less realistic images to speed up the rendering and use fewer resources. Such programs may do so by, for example, rendering fewer features within the scene or by using pre-rendered elements that do not necessarily correspond with the actual scene being rendered.
One such lighting effect that can require intensive resources to properly incorporate into a three-dimensional model is specular reflections. Specular reflection of light occurs when light hits a surface that reflects the light in a relatively narrow range of directions, forming the appearance of shiny spots on an object. Proper rendering of specular reflection can contribute significantly to the realism of a three-dimensional model.
Many conventional methods of calculating specular reflection have various disadvantages. For instance, when multiple light sources are present in a scene, many conventional methods calculate specular reflection for each individual light and combine the effect of the individual lights. For multiple lights, the computation load can increase linearly with additional lights. Because the number of lights is typically large in certain settings, such as in offices and department stores, rendering can slow down (many-fold) in these applications.
A second limitation with conventional methods lies in the algorithm used to calculate specular reflection. Some conventional methods model the specular reflection value for each individual light based on the equation Si=Iiks(Ri·Vi)n. In this equation, Ii is the intensity of light source i, ks is a specular reflection constant, and R·V is the dot product of reflection vector R and viewing vector V shown in FIG. 1. The parameter n is a variable reflecting the smoothness of a surface. Because the incidence angle α between the incident light vector L and the normal vector N equals the reflection angle α between R and N, R can be computed as R=2(L·N)N−L. These conventional methods require calculation of not only the viewing vector V, but also the reflection vector R, which often changes at different points of a surface. The calculation of the reflection vector R adds to the computational burden for the simulation of specular reflection.
An additional problem exists in conventional methods using the foregoing algorithm. These conventional methods can require calculating the dot product of reflection ray vector R and viewing vector V, or the cosine value of the viewing angle, cos(β). These methods then can typically raise the value to the power of 200 or higher to simulate the appearance of shiny surfaces. These methods need to repeat the same calculation for each point on an object's surface, and for every viewing perspective in a dynamic viewing situation. These methods can substantially increase the computational load and slow down simulation of the object in dynamic scenes.
The foregoing problems make many of the conventional methods too slow to be practical in real-time rendering of dynamic scenes, such as in a virtual walk-through of a three-dimensional architectural model, video games, or other virtual environments. Computer generated graphics for these settings typically require rendering rate of 30 frames per second or higher to achieve smooth motion and realistic appearance.
One method intended to circumvent the foregoing problems is the “baking” method. The baking method involves pre-calculating the specular reflection of an object in a particular setting, usually with a fixed lighting condition. The convention software then applies the same reflection of the object to different frames of a video for a dynamic scene, regardless of the changes of the incident vector L, reflection vector R, or the viewing vector V. Although this method is computationally simpler than conventional methods that calculate specular reflection for each frame, the realism of a rendered object is substantially inferior when object placement and the viewing angle deviate from the original setting.
Some conventional methods used in video games utilize “ambient occlusion” techniques to improve realism. The results, however, are not realistic due to the use of a single, global ambient light source, and conventional design spaces tend to incorporate a plurality of light sources. In addition, ambient occlusion techniques typically do not allow for dynamic differential of lighting in different areas of the layout or scene, due to the single, global light source nature. Ambient occlusion techniques usually have no ability (or are significantly limited) to turn off lighting in one area of the scene, and turn on lighting in another area.
Accordingly, there are several disadvantages in the art that can be addressed.